package com.cskaoyan.user.controller.feign;

import com.cskaoyan.user.UserVerifyDTO;
import com.cskaoyan.user.converter.UserToOrderConverterMapper;
import com.cskaoyan.user.dal.entitys.UserVerify;
import com.cskaoyan.user.dal.persistence.UserVerifyMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author silic xia
 * @since 2022/12/03 18:13
 */
@RestController
public class OrderFeignController {

    @Autowired
    UserVerifyMapper userVerifyMapper;
    @Autowired
    UserToOrderConverterMapper userToOrderConverterMapper;

    @GetMapping("/feign/order")
    public UserVerifyDTO selectUserVerifyByPrimaryKey(Long userId){
        UserVerify userVerify = userVerifyMapper.selectByPrimaryKey(userId);
        UserVerifyDTO userVerifyDTO = userToOrderConverterMapper.userVerifyToUserVerifyDTO(userVerify);
        return userVerifyDTO;
    }
}

